package taller2.view.windows.MainWindows;

import taller2.controller.listeners.evaluateMeButtons.EvaluateMeButtonListener;
import taller2.controller.listeners.evaluateMeButtons.FordFulkersonEvaluateMeButtonListener;
import taller2.interfaces.AlgorithmApplicator;
import taller2.interfaces.Graph;
import taller2.model.factorys.GraphFactory;
import taller2.utils.Constants;
import taller2.utils.Constants.Colores;
import taller2.utils.Point;
import taller2.view.draws.GraphDrawer;
import taller2.view.menus.MainEdittingMenus.FordFulkersonMainEdittingMenu;
import taller2.view.menus.MainEdittingMenus.MainEdittingMenu;
import taller2.view.windows.MyWindow;

public class FordFulkersonMainWindow extends MainWindow{
	Graph reference;
	GraphDrawer referenceDrawer;

	public FordFulkersonMainWindow(MyWindow parent, String path, boolean directed,
			AlgorithmApplicator algorithmApplicator) {
		super(parent, path, directed, algorithmApplicator,new FordFulkersonEvaluateMeButtonListener(algorithmApplicator));

		reference = GraphFactory.directedGgraphInstance();
		
		reference.add(new Point(30, 50), "Begin");
		reference.add(new Point(110, 50), "End");
		reference.add(new Point(180, 50), "Visited");
		reference.add(new Point(260, 50), "");

		reference.getNodes().get(0).changeColor(Colores.purple);
		reference.getNodes().get(1).changeColor(Colores.green);
		reference.getNodes().get(2).changeColor(Colores.red);

		reference.getNodes().get(3).setMarker("Capacity/Usage");

		referenceDrawer = new GraphDrawer(reference, Constants.selectedColor, Constants.unSelectedColor);
		referenceDrawer.resize(50, 4, Constants.SampleTextSize);

		area.addDrawable(referenceDrawer);
	}

	//existe para redefinir esto:
	@Override
	protected MainEdittingMenu createMainEdittingMenu(EvaluateMeButtonListener listener){
		return (new FordFulkersonMainEdittingMenu(this, area,graph,this.algorithmApplicator,listener));
	}
	
}
